<?php

	# Initilize template file with a default value
	$scripts 	= array();
	$css 		= array();
	$view		= array();

	# Quan ly cac doan code phat sinh	
	$configs = new Pick_Core_Configs($db);	
	
	# System configuration
	$siteConfigs	= $configs->getObject('company');
	$template->assign("configs",$configs);
	
	/* Lay thong tin cong ty */
	$companyname 	= $siteConfigs->getProperty($lang.'_company');
	$template->assign("companyname",$companyname);
	
	$address 		= $siteConfigs->getProperty($lang.'_address');
	$template->assign("address",$address);
	
	$telecom 		= $siteConfigs->getProperty('tel');
	$template->assign("telecom",$telecom);	
	
	$fax 			= $siteConfigs->getProperty('fax');
	$template->assign("fax",$fax);
	
	$hotline 		= $siteConfigs->getProperty('hotline');
	$template->assign("hotline",$hotline);
	
	$admin_mail 	= $siteConfigs->getProperty('admin_mail');
	$template->assign("admin_mail",$admin_mail);

	$coordinates_x 	= $siteConfigs->getProperty('coordinates_x');
	$template->assign("coordinates_x",$coordinates_x);

	$coordinates_y 	= $siteConfigs->getProperty('coordinates_y');
	$template->assign("coordinates_y", $coordinates_y);
	
	$websitename 	= DOMAIN;
	$template->assign("websitename",$websitename);
	
	$api			= $siteConfigs->getProperty('api'); 
	$template->assign("api",$api);
    
    /* Duong dan hinh anh trong admin*/
	$base_url_images = PROTOCOL . DOMAIN . (FOLDER?'/'. FOLDER . "/upload/images":"/upload/images");
	$template->assign("base_url_images", $base_url_images);
	$nameFileLogo=$siteConfigs->getProperty('avatar'); 
	$template->assign("nameFileLogo",$nameFileLogo);
	$template->assign("logoUrl",$base_url_images."/logocp/storage/".$nameFileLogo);	
	
	/* Lay thong tin cau hinh */
	$generalConfigs	= $configs->getObject('general');
	$template->assign("configs",$configs);
        
	$numItemIndex = $generalConfigs->getProperty('news_update_items_per_row');	
	$template->assign("numItemIndex",$numItemIndex);        
		
	$items_per_pages = $generalConfigs->getProperty('item_per_row');
	$template->assign("items_per_pages", $items_per_pages);	
	
	$popup          = $generalConfigs->getProperty('check_popup');
	$template->assign("popup",$popup);		
	
	$currency = $generalConfigs->getProperty('currency');
	$template->assign("currency", $currency);